package o;

import android.content.Context;
import o.brc.e;
import o.bww.h;
import o.bxf.b;

public class bxt {
    private boolean ॱ = false;

    public fkd<bxc> ˊ(Context context, int i, int i2, long j, int i3, String str, int i4, boolean z) {
        this.ॱ = z;
        final fkh o_fkh = new fkh();
        if (!doo.ˊ(bqy.ˋ().ˏ())) {
            if (z) {
                ezn.ˊ().ˊ(context.getString(h.ʽॱ));
            } else {
                evk.ˏ(context, h.ʽॱ, 0).ˋ();
            }
            o_fkh.ˋ(new bxc(8, false));
            o_fkh.ˏ();
            return o_fkh.ˊ();
        } else if (ˎ(context, i)) {
            final Context context2 = context;
            final int i5 = i2;
            final long j2 = j;
            final int i6 = i3;
            final String str2 = str;
            final int i7 = i4;
            ((cbh) fho.ˏ().ˋ("User").ॱ(cbh.class)).ˎ(context, 11, z).ˏ(new fjq<Boolean>(this) {
                final /* synthetic */ bxt ᐝ;

                public void onComplete(fjo<Boolean> o_fjo_java_lang_Boolean) {
                    if (!o_fjo_java_lang_Boolean.ˊ()) {
                        return;
                    }
                    if (((Boolean) o_fjo_java_lang_Boolean.ॱ()).booleanValue()) {
                        this.ᐝ.ˎ(context2, i5, j2, i6, o_fkh, str2, i7);
                        return;
                    }
                    o_fkh.ˋ(new bxc(10, false));
                    o_fkh.ˏ();
                }
            });
            return o_fkh.ˊ();
        } else {
            o_fkh.ˋ(new bxc(10, false));
            o_fkh.ˏ();
            return o_fkh.ˊ();
        }
    }

    private void ˎ(Context context, int i, long j, int i2, fkh<bxc> o_fkh_o_bxc, String str, int i3) {
        o_fkh_o_bxc.ˋ(new bxc(9, true));
        final int i4 = i3;
        final int i5 = i;
        final int i6 = i2;
        final Context context2 = context;
        final String str2 = str;
        final long j2 = j;
        final fkh<bxc> o_fkh_o_bxc2 = o_fkh_o_bxc;
        ((brc) fho.ˏ().ˋ("Base").ॱ(brc.class)).ˋ(new b(i, j, i2).ˊ("").ˎ(bsv.ॱ(str)).ˊ(), new e<bxf, bxi>(this) {
            final /* synthetic */ bxt ʽ;

            public /* synthetic */ void ˋ(Object obj, Object obj2) {
                ˎ((bxf) obj, (bxi) obj2);
            }

            public /* synthetic */ void ˏ(Object obj, Object obj2) {
                ˊ((bxf) obj, (bxi) obj2);
            }

            public void ˊ(bxf o_bxf, bxi o_bxi) {
            }

            public void ˎ(bxf o_bxf, bxi o_bxi) {
                boolean z = o_bxi.getResponseCode() == 0 && o_bxi.getRtnCode_() == 0;
                boolean z2;
                if (o_bxi.getRtnCode_() == 400017) {
                    z2 = true;
                } else {
                    z2 = false;
                }
                boolean z3;
                if (o_bxi.getRtnCode_() == 400018) {
                    z3 = true;
                } else {
                    z3 = false;
                }
                if (z || r1 || r2) {
                    String valueOf = i4 == 0 ? "" : String.valueOf(i4);
                    if (i5 == 0 && i6 == 0) {
                        brd.ॱ.ˏ(bqy.ˋ().ˎ(context2), str2, valueOf, String.valueOf(j2), "");
                    } else if (i5 == 1 && i6 == 0) {
                        brd.ॱ.ˏ(bqy.ˋ().ˎ(context2), str2, valueOf, "", String.valueOf(j2));
                    }
                    o_fkh_o_bxc2.ˋ(new bxc(0, true));
                } else {
                    if (this.ʽ.ॱ) {
                        ezn.ˊ().ˊ(context2.getString(bse.ˏ.ॱ(o_bxi.getRtnCode_()).ˏ()));
                    } else {
                        evk.ˏ(context2.getString(bse.ˏ.ॱ(o_bxi.getRtnCode_()).ˏ()));
                    }
                    o_fkh_o_bxc2.ˋ(new bxc(-1, false));
                }
                o_fkh_o_bxc2.ˏ();
            }
        });
    }

    private boolean ˎ(Context context, int i) {
        String string;
        switch (i) {
            case 1:
                string = context.getString(bse.ˏ.ॱ(400006).ˏ());
                break;
            case 2:
                string = context.getString(bse.ˏ.ॱ(400007).ˏ());
                break;
            case 3:
                string = context.getString(bse.ˏ.ॱ(400008).ˏ());
                break;
            default:
                return true;
        }
        if (this.ॱ) {
            ezn.ˊ().ˊ(string);
        } else {
            evk.ˏ(string);
        }
        return false;
    }
}
